#ifndef _FPOD_READER_H_
#define _FPOD_READER_H_

#include <stdint.h>
#include <string>
#include <vector>
#include <fanllvm/core/minizip/unzip.h>


/**
 * A class that can read files from a .pod file (which is just a zip-file)
 */
class FPodReader
{
public:
  FPodReader();
  ~FPodReader();

  bool openPod(const std::string& podPath);
  void closePod();
  bool setCurrentFile(const std::string& filename);
  const std::string& getCurrentFile();
  std::vector<std::string> listFCodeFiles();

  uint8_t readUInt8();
  uint16_t readUInt16();
  uint32_t readUInt32();
  uint64_t readUInt64();
  int8_t readInt8();
  int16_t readInt16();
  int32_t readInt32();
  int64_t readInt64();
  float readFloat();
  double readDouble();
  std::string readString();

private:
  unzFile m_podFile;
  std::string m_currentFile;
  uint8_t* m_currentBuf;
  uint32_t m_currentBufPos;
  uint32_t m_currentBufLen;
};


#endif
